﻿//========================================================= 
/**@file VisualStudioOutputAppender.h
 * @brief 将日志输出到VS输出窗口中
 * 
 * @date 2018-07-03   10:36:37
 * @author Zhyioo 
 * @version 1.0
 */ 
//--------------------------------------------------------- 
#ifndef _LIBZHOUYB_VISUALSTUDIOOUTPUTAPPENDER_H_
#define _LIBZHOUYB_VISUALSTUDIOOUTPUTAPPENDER_H_
//--------------------------------------------------------- 
#include "../ILogCat.h"
//--------------------------------------------------------- 
namespace zhou_yb {
namespace extension {
namespace logcat {
//--------------------------------------------------------- 
class VisualStudioOutputAppender : public ILogAppender, public RefObject
{
public:
    virtual void append(LogLevel lv, const char* tag, const char* str)
    {
        CharConverter cvt;
        OutputDebugString(cvt.to_char_t(str));
        OutputDebugString(cvt.to_char_t("\n"));
    }
};
//--------------------------------------------------------- 
} // namespace logcat
} // namespace extension
} // namespace zhou_yb
//--------------------------------------------------------- 
#endif // _LIBZHOUYB_VISUALSTUDIOOUTPUTAPPENDER_H_
//========================================================= 